<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Sort extends Model
{
    protected $table = 'sort';

    protected $primaryKey = 'id';

    public $timestamps = true;

    public function findSonSort()
    {
        return $this->hasMany('App\Model\Sort', 'pid');
    }

    public function findFatherSort()
    {
        return $this->belongsTo('App\Model\Sort', 'pid');
    }

    public function findGoods()
    {
        return $this->hasMany('App\Model\Goods', 'sid');
    }

    public function findSalePromotion()
    {
        return $this->hasMany('App\Model\Sale_promotion', 'sid');
    }
}
